//
//  comicCollectionView.m
//  动漫之家
//
//  Created by 王少泽 on 16/12/24.
//  Copyright © 2016年 王少泽. All rights reserved.
//

#import "comicCollectionView.h"
#import "ChapterCollectionViewCell.h"
#import "AppDelegate.h"

@implementation comicCollectionView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:[self lazyLoadCollectionView]];
    }
    return self;
}

- (UICollectionView* )lazyLoadCollectionView
{
    if (_comicCollectionView == nil) {
        UICollectionViewFlowLayout* flowLayout = [[UICollectionViewFlowLayout alloc]init];
        flowLayout.itemSize = CGSizeMake(60, 40);
        flowLayout.minimumLineSpacing = 5;
        flowLayout.minimumInteritemSpacing = 5;
        _comicCollectionView = [[UICollectionView alloc]initWithFrame:self.bounds collectionViewLayout:flowLayout];
        [_comicCollectionView registerNib:[UINib nibWithNibName:@"ChapterCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"comicCell"];
    }
    return _comicCollectionView;
}

#pragma mark collectionView的代理方法


@end
